<h1>Edit Profile</h1>

<%="<"%>%- if <%= @name %>.errors %>
  <ul class="errors">
  <%="<"%>%- <%= @name %>.errors.each do |error| %>
    <li><%="<"%>%= error.to_s %></li>
  <%="<"%>%- end %>
  </ul>
<%="<"%>%- end %>

<form action="/profile" method="post">
  <%="<"%>%= csrf_tag %>
  <input type="hidden" name="_method" value="patch" />

  <div class="form-group">
    <input class="form-control" type="email" name="email" placeholder="Email" value="<%="<"%>%= <%= @name %>.email %>" />
  </div>
  <%="<"%>%= submit("Update", class: "btn btn-success btn-sm") %>
  <%="<"%>%= link_to("Profile", "/profile", class: "btn btn-light btn-sm") %>
</form>
